<template>
        <el-scrollbar style="height:100%;">
            <div class="container p-40">
                <div>
                    <el-form
                        v-loading="loading"
                        ref="basicForm"
                        :rules="rules"
                        :model="basicForm"
                        label-width="100px"
                    >
                        <p class="f-17 m-b-20">基本信息</p>
                        <el-row :gutter="40">
                            <el-col :span="8">
                                <el-form-item label="楼宇名称" prop="buildingName">
                                    <el-input
                                        v-model="basicForm.buildingName"
                                        placeholder="请填写楼宇名称"
                                    ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="所属区域" prop="areaNumberId">
                                    <el-select
                                        v-model="basicForm.areaNumberId"
                                        placeholder="请选择所属区域编码"
                                    >
                                        <el-option
                                            v-for="item in area"
                                            :key="item.pkBasicdataId"
                                            :value="item.pkBasicdataId"
                                            :label="item.itemName"
                                        ></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item
                                    label="房源类型"
                                    prop="housingAssetsTypeId"
                                >
                                    <el-select
                                        v-model="basicForm.housingAssetsTypeId"
                                        placeholder="请选择房源类型"
                                    >
                                        <el-option
                                            v-for="item in housingAssetsType"
                                            :key="item.pkBasicdataId"
                                            :value="item.pkBasicdataId"
                                            :label="item.itemName"
                                        >
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row :gutter="40">
                            <el-col :span="8">
                                <el-form-item label="抵押情况" prop="mortgageSituation">
                                    <el-radio-group
                                        v-model="basicForm.mortgageSituation"
                                    >
                                        <el-radio label="抵押"></el-radio>
                                        <el-radio label="未抵押"></el-radio>
                                    </el-radio-group>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="总楼层" prop="totalFloor">
                                    <el-input
                                        type="number"
                                        v-model="basicForm.totalFloor"
                                        placeholder="请填写楼层数量"
                                    ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="登记日期" prop="registerDate">
                                    <el-date-picker
                                        value-format="yyyy-MM-dd HH:mm:ss"
                                        type="date"
                                        placeholder="选择登记日期"
                                        v-model="basicForm.registerDate"
                                        style="width: 100%"
                                    ></el-date-picker>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row :gutter="40">
                            <el-col :span="8">
                                <el-form-item label="是否有产权" prop="propertyRights">
                                    <el-select v-model="basicForm.propertyRights">
                                        <el-option
                                            label="无产权"
                                            :value="0"
                                        ></el-option>
                                        <el-option
                                            label="有产权"
                                            :value="1"
                                        ></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <template v-if="basicForm.propertyRights === 1">
                                <el-col :span="8">
                                    <el-form-item
                                        label="房产证编号"
                                        prop="housePropertyCertificateNo"
                                    >
                                        <el-input
                                            v-model="
                                                basicForm.housePropertyCertificateNo
                                            "
                                            placeholder="请填写房产证编号"
                                        ></el-input>
                                    </el-form-item>
                                </el-col>

                                <el-col :span="8">
                                    <el-form-item label="发证单位" prop="issueUnit">
                                        <el-input
                                            v-model="basicForm.issueUnit"
                                            placeholder="请填写发证单位"
                                        ></el-input>
                                    </el-form-item>
                                </el-col>
                            </template>
                            <template v-else>
                                <el-col :span="8">
                                    <el-form-item
                                        label="产权情况说明"
                                        prop="descriptionPropertyRights"
                                    >
                                        <el-input
                                            v-model="
                                                basicForm.descriptionPropertyRights
                                            "
                                            placeholder="请填写产权情况说明"
                                        ></el-input>
                                    </el-form-item>
                                </el-col>
                            </template>

                            <el-col :span="8">
                                <el-form-item
                                    label="物业公司"
                                    prop="fkPropertyCompanyId"
                                >
                                    <el-select
                                        @change="propertyChange"
                                        v-model="basicForm.fkPropertyCompanyId"
                                        placeholder="请选择物业公司"
                                    >
                                        <el-option
                                            v-for="item in property"
                                            :key="item.pkBasicdataId"
                                            :value="item.pkBasicdataId"
                                            :label="item.itemName"
                                        ></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>

                            <el-col :span="8">
                                <el-form-item
                                    label="管理处"
                                    prop="fkAdministrativeOfficeId"
                                >
                                    <el-select
                                        v-model="basicForm.fkAdministrativeOfficeId"
                                        placeholder="请选择管理处"
                                    >
                                        <el-option
                                            v-for="item in administrativeOffice"
                                            :key="item.pkBasicdataId"
                                            :value="item.pkBasicdataId"
                                            :label="item.itemName"
                                        ></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>

                            <el-col :span="8">
                                <el-form-item
                                    label="房型分布"
                                    prop="housingDistribution"
                                >
                                    <el-input
                                        type="textarea"
                                        :rows="1"
                                        maxlength="100"
                                        show-word-limit
                                        v-model="basicForm.housingDistribution"
                                        placeholder="请输入房型分布"
                                    ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8" :offset="7"></el-col>
                            <template v-for="(item, index) in obligeeNumber">
                                <el-col :span="5" style="padding-right: 10px">
                                    <el-form-item label="权利人">
                                        <el-select
                                            v-model="obligeeNumber[index].obligeeKey"
                                            placeholder="请选择权力人"
                                        >
                                            <el-option
                                                v-for="item in power"
                                                :key="item.pkBasicdataId"
                                                :value="item.pkBasicdataId"
                                                :label="item.itemName"
                                            ></el-option>
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="2" style="padding-left: 0px">
                                    <el-form-item label-width="0">
                                        <el-input
                                            type="number"
                                            v-model="
                                                obligeeNumber[index].obligeePercentage
                                            "
                                            style="width: 100%"
                                        >
                                            <template slot="suffix">%</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col
                                    :span="1"
                                    style="
                                        height: 30px;
                                        line-height: 30px;
                                        color: #4391fb;
                                        cursor: pointer;
                                        padding: 0;
                                    ">
                                    <i
                                        class="el-icon-circle-close"
                                        v-if="obligeeNumber.length > 1"
                                        @click="obligeeNumber.splice(index, 1)"
                                    ></i>
                                    <i
                                        class="el-icon-circle-plus-outline"
                                        v-if="
                                            index === obligeeNumber.length - 1 &&
                                            obligeeNumber.length < 5
                                        "
                                        @click="obligeeNumber.push({})"
                                    ></i>
                                    &nbsp;
                                </el-col>
                            </template>
                        </el-row>
                        <p class="f-17 m-b-20">土地信息</p>
                        <el-row :gutter="40">
                            <el-col :span="8">
                                <el-form-item label="宗地号" prop="landNumber">
                                    <el-input
                                        v-model="basicForm.landNumber"
                                        placeholder="请填写宗地号"
                                    ></el-input>
                                </el-form-item>
                            </el-col>

                            <el-col :span="8">
                                <el-form-item label="宗地面积" prop="landArea">
                                    <el-input
                                        type="number"
                                        v-model="basicForm.landArea"
                                        placeholder="请填写宗地面积"
                                    >
                                        <template slot="suffix">㎡</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="土地用途" prop="fkLandPurpose">
                                    <el-input
                                        v-model="basicForm.fkLandPurpose"
                                        placeholder="请输入土地用途"
                                    ></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="使用年限">
                                    <el-input
                                        type="number"
                                        v-model="basicForm.usefulLife"
                                        placeholder="使用年限"
                                    >
                                        <template slot="suffix"> 年 </template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="使用起始日" prop="usefulStartDate">
                                    <el-date-picker
                                        value-format="yyyy-MM-dd HH:mm:ss"
                                        type="date"
                                        placeholder="选择起始日期"
                                        v-model="basicForm.usefulStartDate"
                                        style="width: 100%"
                                    ></el-date-picker>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="24">
                                <el-form-item label="地理位置" class="fack-must">
                                    <el-col :span="4" style="padding-left: 0px">
                                        <el-form-item prop="provinceId" label-width="0">
                                            <el-select
                                                @change="provincesChange"
                                                v-model="basicForm.provinceId"
                                                placeholder="省"
                                            >
                                                <el-option
                                                    v-for="item in provinces"
                                                    :label="item.areaname"
                                                    :value="item.id"
                                                ></el-option>
                                            </el-select>
                                        </el-form-item>
                                    </el-col>
                                    <el-col :span="4">
                                        <el-form-item prop="cityId" label-width="0">
                                            <el-select
                                                @change="citysChange"
                                                v-model="basicForm.cityId"
                                                placeholder="市"
                                            >
                                                <el-option
                                                    v-for="item in citys"
                                                    :label="item.areaname"
                                                    :value="item.id"
                                                ></el-option>
                                            </el-select>
                                        </el-form-item>
                                    </el-col>
                                    <el-col :span="4">
                                        <el-form-item prop="areaId" label-width="0">
                                            <el-select
                                                @change="areasChange"
                                                v-model="basicForm.areaId"
                                                placeholder="区"
                                            >
                                                <el-option
                                                    v-for="item in areas"
                                                    :label="item.areaname"
                                                    :value="item.id"
                                                ></el-option>
                                            </el-select>
                                        </el-form-item>
                                    </el-col>
                                    <el-col :span="4">
                                        <el-form-item prop="streetId" label-width="0">
                                            <el-select
                                                v-model="basicForm.streetId"
                                                placeholder="商圈"
                                            >
                                                <el-option
                                                    v-for="item in streets"
                                                    :label="item.areaname"
                                                    :value="item.id"
                                                ></el-option>
                                            </el-select>
                                        </el-form-item>
                                    </el-col>
                                    <el-col :span="4">
                                        <el-form-item
                                            prop="otherAddresses"
                                            label-width="0"
                                        >
                                            <el-input
                                                v-model="basicForm.otherAddresses"
                                                placeholder="请填写其他地址"
                                            ></el-input>
                                        </el-form-item>
                                    </el-col>
                                </el-form-item>
                            </el-col>
                        </el-row>

                        <p class="f-17 m-b-20">建筑物及附属物</p>
                        <el-row :gutter="40">
                            <el-col :span="8">
                                <el-form-item label="房地产名称" prop="realEstateName">
                                    <el-input
                                        v-model="basicForm.realEstateName"
                                        placeholder="请填写房地产名称"
                                    ></el-input>
                                </el-form-item>
                            </el-col>

                            <el-col :span="8">
                                <el-form-item label="建筑面积" prop="floorage">
                                    <el-input
                                        type="number"
                                        v-model="basicForm.floorage"
                                        placeholder="请填写建筑面积"
                                    >
                                        <template slot="suffix">㎡</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="竣工日期" prop="completionDate">
                                    <el-date-picker
                                        value-format="yyyy-MM-dd HH:mm:ss"
                                        type="date"
                                        placeholder="请选择竣工日期"
                                        v-model="basicForm.completionDate"
                                        style="width: 100%"
                                    ></el-date-picker>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="使用权来源">
                                    <el-input
                                        v-model="basicForm.usefulSource"
                                        placeholder="请填写使用权来源"
                                    ></el-input>
                                </el-form-item>
                            </el-col>

                            <el-col :span="8">
                                <el-form-item label="用途" prop="purpose">
                                    <el-input
                                        v-model="basicForm.purpose"
                                        placeholder="请填写用途"
                                    ></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="登记价">
                                    <el-col :span="12" style="padding-left: 0px">
                                        <el-input
                                            type="number"
                                            v-model="basicForm.registrationPriceRmb"
                                            placeholder="￥ 请填写登记价"
                                        >
                                            <template slot="suffix">人民币</template>
                                        </el-input>
                                    </el-col>
                                    <el-col :span="12">
                                        <el-input
                                            type="number"
                                            v-model="basicForm.registrationPriceHkd"
                                            placeholder="HK$ 请填写"
                                        >
                                            <template slot="suffix">港币</template>
                                        </el-input>
                                    </el-col>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="24">
                                <el-form-item label-width="120px" label="房产证扫描件">
                                    <up-img
                                        v-model="basicForm.propertyOwnershipCertificate"
                                        imgWidth="150px"
                                        imgHeight="100px"
                                        :imgLength="7"
                                        btnImg="/static/images/title-deed-icon.png"
                                        ref="uploadImg"
                                    ></up-img>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                    <el-row justify="center" style="margin-top: 1rem">
                        <el-col :span="4" :offset="10">
                            <el-button
                                type="primary"
                                @click="submitForm"
                                :loading="canSubmit"
                                >确定</el-button
                            >
                            <el-button @click="colse">取消</el-button>
                        </el-col>
                    </el-row>
                </div>
            </div>
        </el-scrollbar>
</template>

<script>
import {
    addBuilding,
    getBuildingById,
    updateHouses,
} from "@/api/house/building/building.js";
import upImg from '@/components/upImg'
import {
    getOneAll,
    getAllByTwo,
    selectNameToId,
    getPosition,
    UploadImage,
} from "@/api/common/common.js";

export default {
    components: {
        upImg
    },
    watch: {
        obligeeNumber(oldVal, newVal) {
            if (this.obligeeNumber.length > 5) {
                this.obligeeNumber.pop();
            }
        }
    },
    data() {
        return {
            InitOldData: "",//初始数据
            obligeeNumber: [{}],
            canSubmit: false,
            isUpdate: false,
            loading: false,
            provinces: [],
            provinceId: 0,
            citys: [],
            areas: [],
            streets: [],
            //区域
            area: [],
            //物业
            property: [],
            //权利人
            power: [],
            //房源类型
            housingAssetsType: [],
            administrativeOffice: [],
            basicForm: {
                propertyOwnershipCertificate: [],
                createdBy: 1,
                lastUpdatedBy: 1,
                cityId: null,
                areaId: null,
                streetId: null,
                obligeeKey: null,
                propertyRights: 1
            },
            rules: {
                purpose: [
                    {
                        required: true,
                        message: "请输入楼宇用途",
                    }
                ],
                fkAdministrativeOfficeId: [
                    {
                        required: true,
                        message: "请选择管理处",
                    }
                ],
                fkPropertyCompanyId: [
                    {
                        required: true,
                        message: "请选择物业公司",
                    }
                ],
                propertyOwnershipCertificate: [
                    {
                        required: true,
                        message: "请上传房产证扫描件",
                    }
                ],
                provinceId: [{
                    required: true,
                    message: "请选择省份",
                }],
                cityId: [{
                    required: true,
                    message: "请选择市",
                }],
                areaId: [{
                    required: true,
                    message: "请选择区域",
                }],
                streetId: [{
                    required: true,
                    message: "请选择商圈",
                }],
                otherAddresses: [
                    {
                        required: true,
                        message: "请选择其他地址",
                    }
                ],
                propertyRights: [
                    {
                        required: true,
                        message: "请选择产权情况",
                    }
                ],
                housingAssetsTypeId: [
                    {
                        required: true,
                        message: "请选择房源类型",
                    }
                ],
                buildingName: [
                    {
                        required: true,
                        message: "请输入楼宇名称",
                    }
                ],
                areaNumberId: [
                    {
                        required: true,
                        message: "请选择所属区域",
                    },
                ],
                mortgageSituation: [
                    {
                        required: true,
                        message: "请选择抵押情况",
                    },
                ],
                totalFloor: [
                    {
                        required: true,
                        message: "请填写楼层数量",
                    },
                ],
                obligeeKey: [
                    {
                        required: true,
                        message: "请选择权利人",
                    },
                ],
                registerDate: [
                    {
                        required: true,
                        message: "请选择登记日期",
                    },
                ],
                housePropertyCertificateNo: [
                    {
                        required: true,
                        message: "请填写房产证编号",
                    },
                ],
                housingDistribution: [
                    {
                        required: true,
                        message: "请输入房型分布"
                    }
                ],
                landNumber: [
                    {
                        required: false,
                        message: "请填写宗地号",
                    },
                ],
                landArea: [
                    {
                        required: true,
                        message: "请填写宗地面积",
                    },
                    { validator: this.$rules.PriceNumber }
                ],
                fkLandPurpose: [
                    {
                        required: false,
                        message: "请输入土地用途",
                    },
                ],
                usefulStartDate: [
                    {
                        required: false,
                        message: "请选择创建日期",
                    },
                ],
                realEstateName: [
                    {
                        required: true,
                        message: "请填写房地产名称",
                    },
                ],
                floorage: [
                    {
                        required: true,
                        message: "请填写建筑面积",
                    },
                    { validator: this.$rules.PriceNumber }

                ],
                completionDate: [
                    {
                        required: false,
                        message: "请填写竣工日期",
                    },
                ],
                issueUnit: [
                    {
                        required: true,
                        message: "请输入发证单位",
                    }
                ],
                descriptionPropertyRights: [
                    {
                        required: true,
                        message: "请输入产权情况说明",
                    }
                ]
            },
        };
    },
    methods: {
        submitForm() {
            this.$refs["basicForm"].validate((valid) => {
                if (valid) {
                    this.canSubmit = true;
                    this.$refs['uploadImg'].submit().then(res => {
                        //有产权 则回显 有产权
                        if (this.basicForm.propertyRights == '1') this.basicForm.descriptionPropertyRights = '有产权';
                        this.obligeeNumber.forEach((v, i) => {
                            switch (i) {
                                case 0:
                                    this.basicForm.obligeeKeyOne = v.obligeeKey;
                                    this.basicForm.obligeePercentageOne = v.obligeePercentage;
                                    break;
                                case 1:
                                    this.basicForm.obligeeKeyTwo = v.obligeeKey;
                                    this.basicForm.obligeePercentageTwo = v.obligeePercentage;
                                    break;
                                case 2:
                                    this.basicForm.obligeeKeyThree = v.obligeeKey;
                                    this.basicForm.obligeePercentageThree = v.obligeePercentage;
                                    break;
                                case 3:
                                    this.basicForm.obligeeKeyFour = v.obligeeKey;
                                    this.basicForm.obligeePercentageFour = v.obligeePercentage;
                                    break;
                                case 4:
                                    this.basicForm.obligeeKeyFive = v.obligeeKey;
                                    this.basicForm.obligeePercentageFive = v.obligeePercentage;
                                    break;
                            }
                        });
                        if (!this.isUpdate) {
                            addBuilding(this.basicForm).then((result) => {
                                if (result.code === 10000) {
                                    this.$message.success(result.msg);
                                    this.colse();
                                }
                                this.canSubmit = true;
                            }).catch(_ => {
                                this.canSubmit = true;
                            });
                        } else {
                            updateHouses(this.basicForm).then((result) => {
                                if (result.code === 10000) {
                                    this.$message.success(result.msg);
                                    this.colse();
                                }
                                this.canSubmit = true;
                            }).catch(_ => {
                                this.canSubmit = true;
                            });
                        }
                    }).catch(_ => {
                        this.canSubmit = false;
                    });
                }
            });
        },
        colse() {
            this.$router.push("/building/list");

            //let rex = this.$route.matched[this.$route.matched.length - 1].regex;
            //this.$store.commit("delTabs", rex);
        },
        provincesChange(v) {
            getPosition(v).then((result) => {
                this.basicForm.cityId = null;
                this.basicForm.areaId = null;
                this.basicForm.streetId = null;
                this.citys = result.data;
            });
        },
        citysChange(v) {
            getPosition(v).then((result) => {
                this.basicForm.areaId = null;
                this.basicForm.streetId = null;
                this.areas = result.data;
            });
        },
        areasChange(v) {
            getPosition(v).then((result) => {
                this.basicForm.streetId = null;
                this.streets = result.data;
            });
        },
        propertyChange() {
            let pkBasicdataId = this.property.filter(v => {
                return v.pkBasicdataId === this.basicForm.fkPropertyCompanyId;
            })[0].pkBasicdataId;
            this.fkAdministrativeOfficeId = null;
            getAllByTwo(pkBasicdataId).then(res => {
                this.administrativeOffice = res.data;
            });
        },
        Init() {
            getPosition(0).then((result) => {
                this.provinces = result.data;
            });
            let that = this;
            let go1 = new Promise(function (resolve, resjevt) {
                getOneAll(selectNameToId('power')).then(res => {
                    //权利人
                    that.power = res.data;
                    resolve();
                });
            });
            let go2 = new Promise(function (reso, resj) {
                getOneAll(selectNameToId('housingType')).then(res => {
                    //户型
                    that.housingAssetsType = res.data;
                    reso();
                });
            });
            let go3 = new Promise(function (reso, resj) {
                getOneAll(selectNameToId('area')).then(res => {
                    that.area = res.data;
                    reso();

                });
            });
            let go4 = new Promise(function (reso, resj) {
                getOneAll(selectNameToId('property')).then(res => {
                    that.property = res.data;
                    reso();
                });
            });
            let go5 = new Promise(function (reso, resj) {
                getOneAll(selectNameToId('houseType')).then(res => {
                    that.houseType = res.data;
                    reso();
                });
            });
            Promise.all([go1, go2, go3, go4, go5]).then(res => {
                if (this.$route.params.id) {
                    this.loading = true;
                    this.isUpdate = true;
                    getBuildingById(this.$route.params.id).then((result) => {
                        this.basicForm = result.data;
                        this.obligeeNumber = [];
                        if (this.basicForm.obligeeKeyOne) {
                            this.obligeeNumber.push({
                                obligeeKey: this.basicForm.obligeeKeyOne,
                                obligeePercentage: this.basicForm.obligeePercentageOne
                            });
                        }
                        if (this.basicForm.obligeeKeyTwo) {
                            this.obligeeNumber.push({
                                obligeeKey: this.basicForm.obligeeKeyTwo,
                                obligeePercentage: this.basicForm.obligeePercentageTwo
                            });
                        }
                        if (this.basicForm.obligeeKeyThree) {
                            this.obligeeNumber.push({
                                obligeeKey: this.basicForm.obligeeKeyThree,
                                obligeePercentage: this.basicForm.obligeePercentageThree
                            });
                        }
                        if (this.basicForm.obligeeKeyFour) {
                            this.obligeeNumber.push({
                                obligeeKey: this.basicForm.obligeeKeyFour,
                                obligeePercentage: this.basicForm.obligeePercentageFour
                            });
                        }
                        if (this.basicForm.obligeeKeyFive) {
                            this.obligeeNumber.push({
                                obligeeKey: this.basicForm.obligeeKeyFive,
                                obligeePercentage: this.basicForm.obligeePercentageFive
                            });
                        }
                        this.loading = false;
                        getPosition(result.data.provinceId).then((result) => {
                            this.citys = result.data;
                        });
                        getPosition(result.data.cityId).then((result) => {
                            this.areas = result.data;
                        });
                        getPosition(result.data.areaId).then((result) => {
                            this.streets = result.data;
                        });
                        if (this.basicForm.fkPropertyCompanyId) {
                            let pkBasicdataId = this.property.filter(v => {
                                return v.pkBasicdataId === this.basicForm.fkPropertyCompanyId;
                            })[0].pkBasicdataId;
                            this.fkAdministrativeOfficeId = null;
                            getAllByTwo(pkBasicdataId).then(res => {
                                this.administrativeOffice = res.data;
                            });
                        }
                    });
                }
            }).catch(res => {
                this.$message.error(res);
            });
        }
    },
    mounted() {
        this.Init();
    },
};
</script>

<style scoped>
>>> .el-upload--picture-card {
    width: 234px;
    height: 156px;
    background-image: url(../../../assets/img/housing/title-deed-icon.png);
}
</style>
